package com.sghd.fight.module.game.config;

import com.sghd.common.ramcache.IEntity;
import com.sghd.common.ramcache.PerPersist;
import com.sghd.common.ramcache.anno.Cached;
import com.sghd.common.ramcache.anno.CachedSizes;
import com.sghd.common.ramcache.anno.Persister;
import com.sghd.common.ramcache.anno.Persisters;
import com.sghd.common.utils.json.JsonUtils;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
@Table(catalog = "bsdld_fight")
@Cached(size = CachedSizes.DEFAULT, persister = @Persister(Persisters.PRE_MINUTE))
public class MonsterConfig implements IEntity<Integer>, PerPersist {
    /** 怪物id*/
    @Id
    private int id;
    /** 名字*/
    private String monsterName;
    /** 怪兽伤害*/
    private int attack;

    public Integer getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getMonsterName() {
        return monsterName;
    }

    public void setMonsterName(String monsterName) {
        this.monsterName = monsterName;
    }

    public int getAttack() {
        return attack;
    }

    public void setAttack(int attack) {
        this.attack = attack;
    }
    @Override
    public void afterLoad() {
    }
    @Override
    public void beforePersist() {
    }
    public MonsterConfig copy(){
        MonsterConfig monsterConfig = new MonsterConfig();
        monsterConfig.id = id;
        monsterConfig.monsterName = monsterName;
        monsterConfig.attack = attack;
        return monsterConfig;
    }

    @Override
    public String toString() {
        return "MonsterConfig{" +
                "id=" + id +
                ", monsterName='" + monsterName + '\'' +
                '}';
    }
}
